module.exports = {
	toast: (msg) => {
		plus.nativeUI.toast(`<font color="#ffffff">${msg}</font>`, {
			background: 'rgba(0,0,0,.7)',
			type: 'richtext',
			style: 'inline',
			icon: '/static/img/logo.png',
			iconWidth: '15px',
			iconHeight: '15px',
			verticalAlign: 'bottom'
		})
	},
	modal: (title, msg, back) => {
		plus.nativeUI.confirm(msg, res => {
			if(back && typeof back == 'function'){
				let params = { confirm: false, cancel: false }
				if(res.index == 0) params.confirm = true
				if(res.index == 1) params.cancel = true
				back(params)
			}
		}, {
			title,
			buttons: ['确认', '取消'],
			verticalAlign: 'center'
		})
	}
}